<!--<?php print <<<EOT
-->
<style type="text/css">
.trbor td{border-bottom:0px;}
.tr2 td{ padding-left:0}
.tr2 th{ padding-left:5px;}
</style>
<div id="breadCrumb">
<!--
EOT;
if($cachetime){print <<<EOT
-->
<span class="fr">下次更新时间:$cachetime</span>
<!--
EOT;
}print <<<EOT
-->
		<img src="$imgpath/$stylepath/thread/home-old.gif" align="absmiddle" />&nbsp;<a href="$db_bfn" title="$db_bbsname">$db_bbsname</a><em>&gt;</em><a href="sort.php">统计信息</a>
</div>
<div class="c"></div>
<div id="pw_content">
<div class="hB mb10">
	<ul class="tabB cc">
<!--
EOT;
${'tmpSort_'.($action ? $action : 'default')} = "class='current'";print <<<EOT
-->
		<li $tmpSort_default ><a href="sort.php">基本统计信息</a></li>
		<li $tmpSort_ipstate ><a href="sort.php?action=ipstate">到访IP统计</a></li>
		<li $tmpSort_team ><a href="sort.php?action=team">管理团队</a></li>
		<li $tmpSort_admin ><a href="sort.php?action=admin">管理统计</a></li>
		<li $tmpSort_online ><a href="sort.php?action=online">在线统计</a></li>
		<li $tmpSort_member ><a href="sort.php?action=member">会员排行</a></li>
		<li $tmpSort_forum ><a href="sort.php?action=forum">版块排行</a></li>
		<li $tmpSort_favor ><a href="sort.php?action=favor">收藏排行Top50</a></li>
		<li $tmpSort_article ><a href="sort.php?action=article">帖子排行</a></li>
	</ul>
</div>

<div class="pd15">
<!--
EOT;
if(empty($action)){print <<<EOT
-->
<div class="t"><table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr3 f_one trbor">
<td width="33%" valign="top">
<div style="padding-left:8%;text-align:left; line-height:150%"><b>会员统计</b><br /><br />
会员总数:$bbsinfo[totalmember]<br /><br />
最新注册会员:<a href="u.php?username=$bbsinfo[newmember]" target="_blank">$bbsinfo[newmember]</a></div>
</td>

<td width="33%" valign="top">
<div style="padding-left:10%;text-align:left; line-height:150%"><b>帖子统计</b><br />
主题数:$topic<br />
帖子数:$article<br />
今 日:$tposts<br />
昨 日:$bbsinfo[yposts]<br />
最高日:$bbsinfo[hposts]</div></td>

<td width="33%" valign="top">
<div style="padding-left:8%;text-align:left; line-height:150%"><b>在线统计</b><br />
在线总数:$usertotal<br />
会员数:$userinbbs<br />
游客数:$guestinbbs<br />
最高在线:$bbsinfo[higholnum]<br />
发生在:$bbsinfo[higholtime]</div></td></tr></table></div>
<!--
EOT;
}elseif($action=='ipstate'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<!--
EOT;
if($type=='month'){print <<<EOT
-->
<tr class="tr2"><th colspan="2"><b>月到访IP统计</b>
<a href="sort.php?action=ipstate&year=$p_year">< </a> $c_year <a href="sort.php?action=ipstate&year=$n_year">></a>
</th></tr>
<!--
EOT;
foreach($m_ipdb as $key => $ip){
$percent=round($ip[nums]/$summip*100,1);
$imgwidth=floor(500*$ip[nums]/($summip+1));
print <<<EOT
-->
<tr class="tr3 f_one"><th width="15%">$ip[month]
<a href="sort.php?action=ipstate&type=day&month=$ip[_month]">查看</a></th>
<th><img src="$imgpath/post/vote/tab-two.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}elseif($type=='day'){print <<<EOT
-->
<tr class="tr2"><th colspan="2">
<a href="sort.php?action=ipstate&year=$Y"><b>月到访IP统计</b></a>
<b>日到访IP统计</b>
<a href="sort.php?action=ipstate&type=day&month=$p_month">< </a> $c_month
<a href="sort.php?action=ipstate&type=day&month=$n_month">></a>
</th></tr>
<!--
EOT;
foreach($d_ipdb as $key => $ip){
$percent=round($ip[nums]/$sumip*100,1);
$imgwidth=floor(500*$ip[nums]/($sumip+1));
print <<<EOT
-->
<tr class="tr3 f_one"><th width="15%">$ip[day]</th>
<th><img src="$imgpath/post/vote/tab-two.gif" width="$imgwidth" height="10" /> $ip[nums]($percent%)</th></tr>
<!--
EOT;
}}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="2"></td></tr>
</table></div>
<!--
EOT;
}elseif($action=='online'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2 tac">
<td>用户名</td>
<td>IP</td>
<td>级别</td>
<td>当前动作</td>
<td>最后活动时间</td>
<td>所在版块</td>
<td>所在主题</td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($threaddb as $thread){
if($thread){
$f_class=$f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
<td>
<b>
<!--
EOT;
if($thread[9]=='<>' && $groupid==3){
print <<<EOT
-->
<a href="u.php?uid=$thread[uid]" target="_blank">$thread[username](隐身)</a>
<!--
EOT;
}elseif($thread[9]=='<>' && $groupid!=3){
print <<<EOT
-->
隐身会员
<!--
EOT;
}else{
print <<<EOT
-->
<a href="u.php?uid=$thread[uid]" target="_blank">$thread[username]</a>
<!--
EOT;
}print <<<EOT
-->
</b></td>
<td>$thread[ip]</td>
<td>$thread[group]</td>
<td>$thread[action]</td>
<td>$thread[lasttime]</td>
<td>$thread[forum]<br /></td>
<td>
<!--
EOT;
if($thread[atc]){print <<<EOT
-->
<a href="read.php?tid=$thread[atc]">进入主题</a>
<!--
EOT;
}print <<<EOT
-->
<br /></td>
</tr>
<!--
EOT;
}}
print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="7"></td></tr>
</table>{$pages}共{$count}人在线</div>

<!--
EOT;
}elseif($action=='team'){print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2 tac">
<td>用户名</td>
<td>系统头衔</td>
<td>会员头衔</td>
<td>最后发表</td>
<td>离开天数</td>
<td>发帖</td>
<td>本月发帖</td>
<td>{$db_rvrcname}</td>
<td>$db_moneyname</td>
<td>会员的历史在线时间</td>
<td>本月在线</td>
</tr>
<!--
EOT;
foreach($teamdb as $key => $team){
print <<<EOT
-->
<tr class="tr3 tac f_one">
<td><a href="u.php?uid=$team[uid]" target="_blank">$team[username]</a></td>
<td>$team[systitle]</td>
<td>$team[memtitle]</td>
<td>$team[lastpost]</td>
<td>$team[leavedays]</td>
<td>$team[postnum]</td>
<td>$team[monthpost]</td>
<td>$team[rvrc]</td>
<td>$team[money]</td>
<td>$team[onlinetime]</td>
<td>$team[monoltime]</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="11"></td></tr>
</table></div>
<div class="t"><table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr><td class="h" colspan="12"><b>版主统计</b></td></tr>
<tr class="tr2 tac">
	<td>版块名称</td>
	<td>版主</td>
	<td>系统头衔</td>
	<td>会员头衔</td>
	<td>最后发表</td>
	<td>离开天数</td>
	<td>本月主题数</td>
	<td>本月发帖</td>
	<td>被点击数</td>
	<td>本月在线</td>
</tr>
<!--
EOT;
foreach($forum as $key => $value){
if($value['cms']=='0' && $forumdb[$key]){
$i=count($forumdb[$key]);
print <<<EOT
-->
<tr class="tr3 tac f_one">
	<td rowspan="$i"><a href="thread.php?fid=$key" target="_blank">$value[name]</a></td>
<!--
EOT;
$j=0;
foreach($forumdb[$key] as $uid=>$member){
$j++;
if($j>1){
print <<<EOT
-->
<tr class="tr3 tac f_one">
<!--
EOT;
}
print <<<EOT
-->
	<td><a href="u.php?uid=$uid" target="_blank">$member[username]</a></td>
	<td>$member[systitle]</td>
	<td>$member[memtitle]</td>
	<td>$member[lastpost]</td>
	<td>$member[leavedays]</td>
	<td>$member[post]</td>
	<td>$member[monthpost]<br /></td>
	<td>$member[hits]<br /></td>
	<td>$member[monoltime]</td>
</tr>
<!--
EOT;
}}}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="10"></td></tr>
</table></div>
<!--
EOT;
} elseif($action=='favor'){ print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2 tac">
	<td>文章</td>
	<td>作者</td>
	<td>版块</td>
	<td>发表时间</td>
	<td>收藏次数</td>
	<td>回复/人气</td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($_SORTDB as $key => $value){
$f_class = $f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
	<td><a href="$value[url]" target="_blank">$value[title]</a></td>
	<td><a href="u.php?uid={$value[addition][authorid]}" target="_blank">{$value[addition][author]}</a></td>
	<td><a href="thread.php?fid=$value[fid]" target="_blank">$value[forum]</a></td>
	<td>$value[posttime]</td>
	<td>$value[value]</td>
	<td>{$value[addition][replies]}/{$value[addition][hits]}</td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="16"></td></tr>
</table></div>
<!--
EOT;
}elseif($action=='admin'){ print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
<tr class="tr2 tac">
	<td>用户名</td>
	<td><a href="$baseurl">系统头衔</a></td>
	<td><a href="$baseurl&type=highlight">加亮</a>$sort_a[highlight]</td>
	<td><a href="$baseurl&type=delete">删除</a>$sort_a[delete]</td>
	<td><a href="$baseurl&type=credit">评分</a>$sort_a[credit]</td>
	<td><a href="$baseurl&type=topped">置顶</a>$sort_a[topped]</td>
	<td><a href="$baseurl&type=edit">编辑</a>$sort_a[edit]</td>
	<td><a href="$baseurl&type=digest">精华</a>$sort_a[digest]</td>
	<td><a href="$baseurl&type=copy">复制</a>$sort_a[copy]</td>
	<td><a href="$baseurl&type=move">移动</a>$sort_a[move]</td>
	<td><a href="$baseurl&type=locked">锁定</a>$sort_a[locked]</td>
	<td><a href="$baseurl&type=push">提前</a>$sort_a[push]</td>
	<td><a href="$baseurl&type=unite">合并</a>$sort_a[unite]</td>
	<td><a href="$baseurl&type=shield">屏蔽</a>$sort_a[shield]</td>
	<td><a href="$baseurl&type=remind">提醒</a>$sort_a[remind]</td>
	<td><a href="$baseurl&type=total">总计$sort_a[total]</a></td>
</tr>
<!--
EOT;
$f_class='f_one';
foreach($admindb as $key => $admin){
$f_class=$f_class=='f_one' ? 'f_two' : 'f_one';
print <<<EOT
-->
<tr class="tr3 tac $f_class">
	<td><a href="u.php?uid=$admin[uid]" target="_blank">$key</a></td>
	<td>{$ltitle[$admin[gid]]}<br /></td>
	<td>$admin[highlight]<br /></td>
	<td>$admin[delete]<br /></td>
	<td>$admin[credit]<br /></td>
	<td>$admin[topped]<br /></td>
	<td>$admin[edit]<br /></td>
	<td>$admin[digest]<br /></td>
	<td>$admin[copy]<br /></td>
	<td>$admin[move]<br /></td>
	<td>$admin[locked]<br /></td>
	<td>$admin[push]<br /></td>
	<td>$admin[unite]<br /></td>
	<td>$admin[shield]<br /></td>
	<td>$admin[remind]<br /></td>
	<td>$admin[total]<br /></td>
</tr>
<!--
EOT;
}print <<<EOT
-->
<tr class="f_one"><td style="height:8px;" colspan="16"></td></tr>
</table></div>
<div style="text-align:right;margin-bottom:25px;">月份:
<!--
EOT;
foreach($month_a as $key=>$value){print <<<EOT
-->
$value
<!--
EOT;
}if($month!=$thismonth && $groupid=='3'){print <<<EOT
-->
&nbsp;<a href="sort.php?action=delsort&month=$month&verify=$verifyhash"><b>删除该月记录</b></a>
<!--
EOT;
}print <<<EOT
-->
&nbsp;&nbsp;</div>
<!--
EOT;
} else{print <<<EOT
-->
<div class="t">
<table width="100%" align="center" cellspacing="0" cellpadding="3">
<tr>
<!--
EOT;
$cid=0;
foreach($_SORTDB as $key=>$_SORT){
$type=!is_numeric($key) ? getLangInfo('other','sort_'.$key) : $_CREDITDB[$key][0];
$cid++;
print <<<EOT
-->
<td valign="top" width="33%">
<div class="t3" style="padding:1px;border:1px solid $tablecolor;width:98%;margin:5px auto">
<table width="100%" cellspacing="0" cellpadding="0" align="center">
<tr class="tr2 tac"><td colspan="3"> &nbsp; {$type}排行榜</td></tr>
<!--
EOT;
$id=0;
foreach($_SORT as $id=>$sort){
$id++;
$class=$id%2==0 ? "f_two" : "f_one";
print <<<EOT
-->
<tr class="tr3 $class">
<td style="border-right:0;width:30px;" class="tac">$id</td>
<td style="border-right:0">
<a href="$show_url=$sort[0]" target="_blank">$sort[1]</a>
</td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td style="border-right:0;width:70px;" class="tar">$sort[2]</td>
<!--
EOT;
}print <<<EOT
-->
</tr>
<!--
EOT;
}if($id<$cachenum){
for($i=$id;$i<$cachenum;$i++){
$id++;
$class=$id%2==0 ? "f_two" : "f_one";
print <<<EOT
-->
<tr class="tr3 $class">
<td style="border-right:0;" class="tac">$id</td>
<td style="border-right:0;"></td>
<!--
EOT;
if($key!='digest'){print <<<EOT
-->
<td style="border-right:0;" class="tar"></td>
<!--
EOT;
}print <<<EOT
-->
</tr>
<!--
EOT;
}}print <<<EOT
-->
</table></div></td>
<!--
EOT;
if($cid%3==0){print <<<EOT
-->
</tr><tr>
<!--
EOT;
}}print <<<EOT
-->
</table></div>
<!--
EOT;
}print <<<EOT
-->
</div>
</div>
<!--
EOT;
?>-->
